package com.supreme.nettyapp.generalclient.mqttclient;

import com.supreme.nettyapp.generalclient.mqttclient.service.MqttClientService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
@ConditionalOnProperty(prefix = "netty.mqtt-client", name = "enabled", havingValue = "true")
public class MqttClientStarter {

    @Resource
    private MqttClientService mqttClientService;

    @PostConstruct
    private void mqttClientStarter() {
        mqttClientService.startNettyClient();
    }
}
